﻿//------------------------------------------------------------------------------
// Copyright © FRA & FV 2014
// All rights reserved
//------------------------------------------------------------------------------
// Binary Serialization SDK
//
// SVN revision information:
//   $Revision: 98 $
//------------------------------------------------------------------------------
using System.IO;

namespace FRAFV.Binary.Serialization
{
	/// <summary>
	/// Provides custom binary serialization and deserialization.
	/// </summary>
	public interface IBinSerializable
	{
		/// <summary>
		/// Initialize new empty object.
		/// </summary>
		void InitBinary();
		/// <summary>
		/// Initialize an object from its binary representation.
		/// </summary>
		/// <param name="reader">
		/// The <see cref="T:System.IO.BinaryReader" /> stream from which the object is initialized.
		/// </param>
		void ReadBinary(BinaryReader reader);
		/// <summary>
		/// Converts an object into its binary representation.
		/// </summary>
		/// <param name="writer">
		/// The <see cref="T:System.IO.BinaryWriter" /> stream to which the object is serialized.
		/// </param>
		void WriteBinary(BinaryWriter writer);
		/// <summary>
		/// Calculates an object serialization data size.
		/// </summary>
		long DataSize { get; }
	}
}
